export default {
	
	state: {
		user: {},
		token:""
	},
	getters: {
		user: state => state.user,
		token: state => state.token,
	},
	mutations: {
		setToken(state, token) {
			state.token = token
			uni.setStorageSync("token", token)
		},
		setUserInfo(state, user) {
			state.user = user
			uni.setStorageSync("userInfo", user)
		}
	},
	actions: {
		setUserInfo(context, user) {
			context.commit("setUserInfo", user)
		},
		getToken(context, token) {
			context.commit("setToken", token)
		}
	}
}
